package com.canbot.u05.bean;

/**
 * 数据库（应用信息表，用于配置主页显示的应用）
 * @author LJ
 */
public class AppInfo {

        /**
         * 自增ID
         */
        private int id;

        /**
         * 应用名称（功能名称）-默认值
         */
        private String appName;

        /**
         * 默认启动关键字--用于声控开启命令
         */
        private String defaultRegexp;

        /**
         * 别名--用于声控开启命令、界面的显示（当设置别名时，页面应用的显示名称为此项内容）
         */
        private String nickname;

        /**
         * 关键字-可设置三个关键字，用于声控开启命令
         */
        private String keyword1;

        /**
         * 关键字-可设置三个关键字，用于声控开启命令
         */
        private String keyword2;

        /**
         * 关键字-可设置三个关键字，用于声控开启命令
         */
        private String keyword3;

        /**
         * 是否设置为主要应用
         */
        private boolean mainFunction = false;


        /**
         * 应用的位置显示顺序-mainFunction=false时，position应设置为-1
         */
        private int position = -1;


        /**
         * 包名
         */
        private String packageName;

        /**
         * 类名
         */
        private String className;

        public AppInfo() {

        }

        public AppInfo(int id, String appName, String nickname, String keyword1, String keyword2, String keyword3, boolean mainFunction, int position, String packageName, String className) {
                this.id = id;
                this.appName = appName;
                this.nickname = nickname;
                this.keyword1 = keyword1;
                this.keyword2 = keyword2;
                this.keyword3 = keyword3;
                this.mainFunction = mainFunction;
                this.position = position;
                this.packageName = packageName;
                this.className = className;
        }

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public String getAppName() {
                return appName;
        }

        public void setAppName(String appName) {
                this.appName = appName;
        }

        public String getNickname() {
                return nickname;
        }

        public void setNickname(String nickname) {
                this.nickname = nickname;
        }

        public String getKeyword1() {
                return keyword1;
        }

        public void setKeyword1(String keyword1) {
                this.keyword1 = keyword1;
        }

        public String getKeyword2() {
                return keyword2;
        }

        public void setKeyword2(String keyword2) {
                this.keyword2 = keyword2;
        }

        public String getKeyword3() {
                return keyword3;
        }

        public void setKeyword3(String keyword3) {
                this.keyword3 = keyword3;
        }

        public int getPosition() {
                return position;
        }

        public void setPosition(int position) {
                if (!mainFunction){
                        this.position = -1;
                }else {
                        this.position = position;
                }

        }

        public boolean isMainFunction() {
                return mainFunction;
        }

        public void setMainFunction(boolean mainFunction) {
                if (!mainFunction){
                        setPosition(-1);
                }
                this.mainFunction = mainFunction;
        }

        public String getPackageName() {
                return packageName;
        }

        public void setPackageName(String packageName) {
                this.packageName = packageName;
        }

        public String getClassName() {
                return className;
        }

        public void setClassName(String className) {
                this.className = className;
        }

        public String getDefaultRegexp() {
                return defaultRegexp;
        }

        public void setDefaultRegexp(String defaultRegexp) {
                this.defaultRegexp = defaultRegexp;
        }

        @Override
        public String toString() {
                return "{" +
                        "id=" + id +
                        ", appName=" + appName +
                        ", defaultRegexp=" + defaultRegexp +
                        ", nickname=" + nickname+
                        ", keyword1=" + keyword1 +
                        ", keyword2=" + keyword2 +
                        ", keyword3=" + keyword3 +
                        ", mainFunction=" + mainFunction +
                        ", position=" + position +
                        ", packageName=" + packageName +
                        ", className=" + className+
                        '}';
        }
}
